<?php $this->headTitle(__('ACL Resources')); ?>
<div id="maincontent">
	<?php echo $this->searchForm(__('Search resource')); ?>
	<table width="100%">
		<thead>
			<th><?php echo $this->sortLink(__('Resource'),'resource') ?></th>
			<th><?php echo $this->sortLink(__('Description'),'description') ?></th>
			<th class="action"><?php echo __('Action'); ?></th>
		</thead>
		<tbody>
			<?php if($this->resources): ?>
				<?php foreach($this->resources as $key => $resource): ?>
					<tr class="<?php echo ($key % 2 == 0)?'even':'odd'; ?>">
						<td><?php echo $resource['resource'] ?></td>
						<td><?php echo $resource['description'] ?></td>
						<td><a class="edit" href="<?php echo $this->baseUrl('admin/aclresource/edit/id/'.$resource['id']) ?><?php echo ($this->page)?"/page/".$this->page:''; ?>">&nbsp;</a>
								<a class="delete-resource delete"
								   del:url="<?php echo $this->siteURL.'/admin/aclresource/delete/id/'.$resource['id']; ?><?php echo ($this->page)?"/page/".$this->page:''; ?>">&nbsp;								  
								</a>
						</td>
					</tr>
				<?php endforeach; ?>
			<?php else: ?>
					<tr><td colspan="3" align="center"><?php echo __('Resource not found'); ?></td></tr>
			<?php endif; ?>
		</tbody>
	</table>
	<?php echo $this->pagination();?>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('.delete-resource').click(function(){
		setDeleteDialog($(this).attr('del:url'));
	});
});
</script>